
<script type="text/javascript" charset="utf-8" src="../../../ueditor1_4_3_3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../ueditor1_4_3_3/ueditor.all.min.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="../../../ueditor1_4_3_3/lang/zh-cn/zh-cn.js"></script>

<div class="layui-form" lay-filter="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">

  

  <div class="layui-form-item" hidden>
    <label class="layui-form-label">复消商品ID</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="gradeId" value="{{ d.params.gradeId || '' }}" lay-verify="gradeId" placeholder="不用填写"  autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">复消商品名称</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="gradeName" value="{{ d.params.gradeName || '' }}" lay-verify="gradeName" placeholder="请输入商品名称" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">原价</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="price" value="{{ d.params.price || '' }}" lay-verify="price" placeholder="请输入商品原价" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">优惠价</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="disPrice" value="{{ d.params.disPrice || '' }}" lay-verify="disPrice" placeholder="请输入优惠价" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">赠送积分</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="givePs" value="{{ d.params.givePs || '' }}" lay-verify="givePs" placeholder="请输入赠送积分" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item" hidden>
    <label class="layui-form-label">复消</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="reConsumption" value="{{ d.params.reConsumption || '' }}" lay-verify="reConsumption" placeholder="请输入复消" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">团队</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="team" value="{{ d.params.team || '0' }}" lay-verify="team" placeholder="请输入团队数" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">直推</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="recommend" value="{{ d.params.recommend || '0' }}" lay-verify="recommend" placeholder="请输入直推数" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">星级条件</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <select name="fromGrade" id="fromselect" lay-filter="fromselect" lay-verify="fromGrade" >
          <option value="-1">游客</option>
          <option value="0">VIP</option>
          <option value="1">一星</option>
          <option value="2">二星</option>
          <option value="3">三星</option>
          <option value="4">四星</option>
          <option value="5">五星</option>
       </select>
        <!-- <input type="text" name="fromGrade" value="{{ d.params.fromGrade || '0' }}" lay-verify="fromGrade" placeholder="请输入星级条件" autocomplete="off" class="layui-input"> -->
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">目标星级</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <select name="toGrade" id="toselect" lay-filter="toselect" value="{{ d.params.toGrade || '' }}"   lay-verify="toGrade" >
          <option value="0">VIP</option>
          <option value="1">一星</option>
          <option value="2">二星</option>
          <option value="3">三星</option>
          <option value="4">四星</option>
          <option value="5">五星</option>
       </select>
        <!-- <input type="text" name="toGrade" value="{{ d.params.toGrade || '' }}" lay-verify="toGrade" placeholder="请输入目标星级" autocomplete="off" class="layui-input"> -->
      </script>
    </div>
  </div>

  
  


  <div class="layui-form-item">
    <label class="layui-form-label">主图</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="mainPicture" value="{{ d.params.mainPicture || '' }}" lay-verify="mainPicture" placeholder="请上传图片" autocomplete="off" class="mainPiccls layui-input" >
      </script>
    </div>
    <button style="float: left;" type="button" class="layui-btn" id="layuiadmin-upload-useradmin">上传图片</button> 
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">轮播图1</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="mainPicture1"  placeholder="请上传图片" autocomplete="off" class="mainPiccls1 layui-input" >
      </script>
    </div>
    <button style="float: left;" type="button" class="layui-btn" id="layuiadmin-upload-useradmin1">上传图片</button> 
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">轮播图2</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="mainPicture2"   placeholder="请上传图片" autocomplete="off" class="mainPiccls2 layui-input" >
      </script>
    </div>
    <button style="float: left;" type="button" class="layui-btn" id="layuiadmin-upload-useradmin2">上传图片</button> 
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
        请使用富文本框全屏编辑图文
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">图文详情</label>
    <div class="layui-input-inline">
        <script id="editor" type="text/plain" style="width:800px;height:100px;"></script>
    </div>
  </div>
    
  <div class="layui-form-item" hidden>
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="textarea" name="content" value="{{ d.params.content || '' }}" lay-verify="content" placeholder="HTML"  autocomplete="off" class="contentval layui-input"/>
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <!-- <button  class="layui-btn" onclick="getContent()">保存图文</button> -->
      <input type="button" lay-submit lay-filter="LAY-user-front-submit" value="确认" class="layui-btn">
    </div>
  </div>
  
</div>

<script src="../../../ueditor1_4_3_3/third-party/jquery-1.10.2.js"></script>
<script>
layui.use(['jquery'],function(){
  var $ = layui.jquery
  ,setter = layui.setter;
  
  var url1 = setter.myurl + 'config';
  
  window.UEDITOR_CONFIG.serverUrl = url1;
  var ue = UE.getEditor('editor');
  
})

function getContent() {
  $(".contentval").val(UE.getEditor('editor').getContent());
  alert("已保存草稿。")
}


layui.use(['admin', 'form', 'upload'], function(data){
  var $ = layui.$
  ,form = layui.form
  ,setter = layui.setter
  ,upload = layui.upload;
  window.UEDITOR_CONFIG = {
    // 服务器统一请求接口路径
    serverUrl: setter.myurl + "config"
  };
  
  //上传头像
  upload.render({
    elem: '#layuiadmin-upload-useradmin'
    ,url: setter.myurl + 'admin/uploadMainPicture'
    ,accept: 'images'
    ,method: 'post'
    ,acceptMime: 'image/*'
    ,done: function(res){
      console.log(res)
      $(".mainPiccls").val(res.data);
      $(this.item).prev("div").children("input").val(res.data)
    }
  });

  //上传头像
  upload.render({
    elem: '#layuiadmin-upload-useradmin1'
    ,url: setter.myurl + 'admin/uploadMainPicture'
    ,accept: 'images'
    ,method: 'post'
    ,acceptMime: 'image/*'
    ,done: function(res){
      console.log(res)
      $(".mainPiccls1").val(res.data);
      $(this.item).prev("div").children("input").val(res.data)
    }
  });

  //上传头像
  upload.render({
    elem: '#layuiadmin-upload-useradmin2'
    ,url: setter.myurl + 'admin/uploadMainPicture'
    ,accept: 'images'
    ,method: 'post'
    ,acceptMime: 'image/*'
    ,done: function(res){
      console.log(res)
      $(".mainPiccls2").val(res.data);
      $(this.item).prev("div").children("input").val(res.data)
    }
  });
})


</script>